<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fm" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<title>Table</title>

<link rel="stylesheet" href="plugins/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="css/global.css" media="all">
<link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/table.css" />
<style type="text/css">
input,.layui-input-width300 {
	width: 300px;
}
</style>
</head>

<body>
	<div class="admin-main">
		<div>
			<form class="layui-form" action="manager/product/addProduct">
				<div class="layui-form-item">
					<label class="layui-form-label">商品名称</label>
					<div class="layui-input-block">
						<input type="text" name="title" required lay-verify="required" placeholder="商品名称" autocomplete="off" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">商品类别</label>
					<div class="layui-input-block layui-input-width300">
						<select style="height:38px" name="typeId" lay-verify="required" class="layui-input-width300">
							<option value="0">无</option>
							<c:forEach items="${categoryList }" var="category">
								<option value="${category.category_id }">${category.category_name }</option>>
							</c:forEach>
						</select>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">商品副标题</label>
					<div class="layui-input-block">
						<input type="text" name="subtitle" required lay-verify="required" placeholder="商品副标题" autocomplete="off" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">广告语</label>
					<div class="layui-input-block">
						<input type="text" name="advertisingLanguage" required lay-verify="required" placeholder="广告语" autocomplete="off" class="layui-input">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">价格</label>
					<div class="layui-input-block">
						<input type="text" name="price" required lay-verify="required" placeholder="价格" autocomplete="off" class="layui-input layui-input-width300">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品折扣</label>
					<div class="layui-input-inline">
						<input type="text" name="discount" value="1" required lay-verify="required" placeholder="商品折扣" autocomplete="off" class="layui-input layui-input-width300">
					</div>
					<div class="layui-form-mid layui-word-aux">1-不打折；5折-0.5</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">商品积分</label>
					<div class="layui-input-inline">
						<input type="text" name="integralNumber" value="1" required lay-verify="required" placeholder="商品积分" autocomplete="off" class="layui-input layui-input-width300">
					</div>
					<div class="layui-form-mid layui-word-aux">购买一件获得积分</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">运费</label>
					<div class="layui-input-block">
						<input type="text" name="freight" value="0" required lay-verify="required" placeholder="运费" autocomplete="off" class="layui-input layui-input-width300">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">库存</label>
					<div class="layui-input-block">
						<input type="text" name="inventoryQuantity" required lay-verify="required" placeholder="库存" autocomplete="off" class="layui-input layui-input-width300">
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">商品图片</label>
					<div class="layui-input-block">
						<script type="text/plain" id="productImage" name="bigImgPath"></script>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label">商品详情</label>
					<div class="layui-input-block">
						<script type="text/plain" id="productDetails" name="productDetails"></script>
					</div>
				</div>
				
				<div class="layui-form-item">
					<label style="margin:-10px" class="layui-form-label">商品状态</label>
					<div style="margin:40px 150px">
						<input style=" width: 25px;" type="radio" name=status value="1" title="出售"
						checked>出售
						<input style=" width: 25px;" type="radio" name=status value="2" title="下架">下架
					<input style=" width: 25px;" type="radio" name="status" value="0" title="禁用">删除
					</div>
				</div>
				
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	
	<script type="text/javascript" src="uedior/ueditor.config.js"></script>
	<script type="text/javascript" src="uedior/ueditor.all.min.js"></script>
	<script type="text/javascript" src="plugins/layui/layui.js"></script>
	<script type="text/javascript">
		UE.getEditor('productImage', {
	        toolbars: [
	            [
	                'undo', //撤销
	                'simpleupload', //单图上传
	                'insertimage', //多图上传
	                'cleardoc', //清空文档
	                'fullscreen', //全屏
	             ]
	        ],
	        initialFrameWidth : 1000,//富文本宽度
	        initialFrameHeight :200,//富文本高度
	    });
		
		 UE.getEditor('productDetails', {
	        toolbars: [
	            [
	                'undo', //撤销
	                'simpleupload', //单图上传
	                'insertimage', //多图上传
	                'cleardoc', //清空文档
	                'fullscreen', //全屏
	             ]
	        ],
	        initialFrameWidth : 1000,//富文本宽度
	        initialFrameHeight :200,//富文本高度
	    });
	</script>
	<script type="text/javascript">
	/*layui.use('form', function() {
			var form = layui.form();

			form.on('submit(formDemo)', function(data) {
				layer.msg(JSON.stringify(data.field));
				return false;
			});
		});
		*/
	</script>
</body>
</html>